package exam.model.dao;

import java.util.List;

import exam.common.util.NullCheckUtil;
import exam.model.entity.TSubQuestionEntity;

public class SubQuestionDAO extends AbstractDao<TSubQuestionEntity>{
	
	public SubQuestionDAO() {
		super(TSubQuestionEntity.class);
	}
	
	public List<TSubQuestionEntity> selectListSubQuestion() {
		return super.selectList("from TSubQuestionEntity");
	}
	
	public TSubQuestionEntity selectByPk(long id) {
		return super.selectByPk(id);
	}
	
	public void insertSubQuestion(TSubQuestionEntity subQuestion) {
		super.insert(subQuestion);
	}
	
	public void updateSubQuestion(TSubQuestionEntity subQuestion) {
			super.update(subQuestion);
	}
	
	public boolean deleteSubQuestion(long id) {
		if (NullCheckUtil.isNUll(selectByPk(id))) {
			return false;
		}
		super.delete(id);
		return true;
	}
}
